package com.wcfsy.wechat.wx.controller;

import java.util.HashMap;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.wcfsy.wechat.wx.entity.OpinionsInfo;
import com.wcfsy.wechat.wx.pagination.IPage;
import com.wcfsy.wechat.wx.pagination.impl.Page;
import com.wcfsy.wechat.wx.sys.dao.UserOpinionsDao;

/**
 * 用户评论管理
 */
@Controller
@RequestMapping("/cms/opinions")
public class UserOpinionController {

	@Resource
	private UserOpinionsDao userOpinionsDao;

	/**
	 * 意见反馈 查询
	 */
	@RequestMapping("/view/page")
	public String listView() {
		return "activity/opinions_list";
	}

	/**
	 * 意见反馈 查询
	 */
	@RequestMapping("/view")
	@ResponseBody
	public IPage<OpinionsInfo> getOpinions(int page, int rows) {
		Map<String, Object> paramMap = new HashMap<String, Object>();
		paramMap.put("index", page);
		paramMap.put("size", rows);
		paramMap.put("limit", "limit");
		return new Page<OpinionsInfo>(userOpinionsDao.findByParam(paramMap),
				userOpinionsDao.count(paramMap), page, rows);

	}

}
